<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>${APP_NAME}</title>
<%@ include file="/commons/includejs.jsp"%>
<script type="text/javascript">
$(function(){
	DWZ.init("resources/dwz/dwz.frag.xml", {
		loginUrl:"login_dialog", loginTitle:"登录",	// 弹出登录对话框
//		loginUrl:"login.html",	// 跳到登录页面
		statusCode:{ok:200, error:300, timeout:301}, //【可选】
//		pageInfo:{pageNum:"page.pageNo", numPerPage:"page.pageSize", orderField:"page.orderBy", orderDirection:"page.order"}, //【可选】
		pageInfo:{pageNum:"pageNo", numPerPage:"pageSize", orderField:"orderBy", orderDirection:"order"}, //【可选】
		debug:true,	// 调试模式 【true|false】
		callback:function(){
			initEnv();
			$("#themeList").theme({themeBase:"resources/dwz/themes"});
		}
	});
	
});

function logoutConfirm(url){
	alertMsg.confirm("你确定退出！", {
		okCall: function(){			
			 window.location.href=url;			
		}
	});
}

function logoutAjaxDone(json){
    if (json.statusCode == DWZ.statusCode.ok){
    	 alertMsg.logoutconfirm(json.message, {
             okCall: function(){
            	 window.location.href="login";            
             }
			}); 	
    }
}

function getCurrentNavtab(){
    return $("ul.navTab-tab li.selected");
}

function dialogReloadNavTab(json){
    DWZ.ajaxDone(json);
    var tabId = getCurrentNavtab().attr("tabid");
    if (json.statusCode == DWZ.statusCode.ok){
        if (json.navTabId || tabId!=null){
            navTab.reload(json.forwardUrl, {navTabId: json.navTabId});
        } else if (json.rel) {
            var $pagerForm = $("#pagerForm", navTab.getCurrentPanel());
            var args = $pagerForm.size()>0 ? $pagerForm.serializeArray() : {}
            navTabPageBreak(args, json.rel);
        }
        if ("closeCurrent" == json.callbackType) {
            $.pdialog.closeCurrent();
        }
    }
}

</script>
<style>
<!--
span.inputInfo{float:left;min-width:200px;}
-->
</style>
</head>
<body scroll="no">
	<div id="layout">
		<div id="header">
			<div class="headerNav">
				<a class="logo" href="http://j-ui.com">标志</a>
				<ul class="nav">
					<li id="switchEnvBox"><a href="javascript:">（<span>北京</span>）切换城市</a>
						<ul>
							<li><a href="sidebar_1.html">北京</a></li>
							<li><a href="sidebar_2.html">上海</a></li>
							<li><a href="sidebar_2.html">南京</a></li>
						</ul>
					</li>
					<li><a href="${ctx}/changepassword" target="dialog" title="修改密码" width="550" height="165">修改密码</a></li>
					<li><a href="javascript:;" onclick="logoutConfirm('${ctx}/logout')">退出</a></li>
				</ul>
				<ul class="themeList" id="themeList">
					<li theme="default"><div class="selected">蓝色</div></li>
					<li theme="green"><div>绿色</div></li>
					<li theme="purple"><div>紫色</div></li>
					<li theme="silver"><div>银色</div></li>
					<li theme="azure"><div>天蓝</div></li>
				</ul>
			</div>
		</div>
		<div id="leftside">
			<div id="sidebar_s">
				<div class="collapse">
					<div class="toggleCollapse"><div></div></div>
				</div>
			</div>
            <div id="sidebar">
                <div class="toggleCollapse"><h2>主菜单</h2><div>收缩</div></div>
                <div class="accordion" fillSpace="sidebar">
                        <div class="accordionHeader">
                            <h2><span>Folder</span>产品管理</h2>
                        </div>
                        <div class="accordionContent">
                            <ul class="tree">
                                <li><a href="${ctx}/category/list" target="navTab" rel="categoryNav">产品类别</a></li>
                                <li><a href="${ctx}/product/list" target="navTab" rel="productNav">产品列表</a></li>
                            </ul>
                        </div>
                        <shiro:hasRole name="admin">
                        <div class="accordionHeader">
                            <h2><span>Folder</span>系统管理</h2>
                        </div>
                        <div class="accordionContent">
                            <ul class="tree treeFolder">
                                <permission:hasAnyPermission name="user:view,user:add">
                                    <li><a href="${ctx}/user/list" target="navTab" rel="userNav">用户列表</a></li>
                                </permission:hasAnyPermission>
                                <permission:hasAnyPermission name="role:view,role:add">
                                    <li><a href="${ctx}/role/list" target="navTab" rel="roleNav">角色列表</a></li>
                                </permission:hasAnyPermission>
                                <permission:hasAnyPermission name="permission:view,permission:add">
                                    <li><a href="${ctx}/authority/list" target="navTab" rel="permissionNav">权限列表</a></li>
                                </permission:hasAnyPermission>
                            </ul>
                        </div>
                        </shiro:hasRole>

                </div>
            </div>
		</div>
		<div id="container">
			<div id="navTab" class="tabsPage">
				<div class="tabsPageHeader">
					<div class="tabsPageHeaderContent"><!-- 显示左右控制时添加 class="tabsPageHeaderMargin" -->
						<ul class="navTab-tab">
							<li tabid="main" class="main"><a href="javascript:;"><span><span class="home_icon">我的主页</span></span></a></li>
						</ul>
					</div>
					<div class="tabsLeft">left</div><!-- 禁用只需要添加一个样式 class="tabsLeft tabsLeftDisabled" -->
					<div class="tabsRight">right</div><!-- 禁用只需要添加一个样式 class="tabsRight tabsRightDisabled" -->
					<div class="tabsMore">more</div>
				</div>
				<ul class="tabsMoreList">
					<li><a href="javascript:;">我的主页</a></li>
				</ul>
					<div class="navTab-panel tabsPageContent layoutBox">
					<div>
						<div class="accountInfo">
							<div class="right">
								<p>12123</p>
							</div>
							<p><span>Hello, , how are you today?   </span></p>
							<p>sdsa</p>
						</div>			
						<div class="pageFormContent" layoutH="80">
	
						</div>

					</div>
			</div>
		</div>
	</div>
	<div id="footer">Copyright &copy; 2010 <a href="demo_page2.html" target="dialog">DWZ团队</a> Tel：010-52897073</div>
</div>
</body>
</html>